package br.ufrgs.tst.tsp.model;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

import br.ufrgs.tsp.model.ICity;
import br.ufrgs.tsp.model.ModelFactory;

public class TestModelFactory {

	/**
	 * Expected city identifier for the unit test assertion.
	 */
	private static final int EXPECTED_CITY_ID = 0;
	
	/**
	 * Model factory used to create {@link ICity} instances.
	 */
	private ModelFactory modelFactory;
	
	@Before
	public void setUp() {
		// Initializes the factory.
		modelFactory = ModelFactory.getInstance();
	}
	
	@Test
	public void createModelObjectTest() {
		// Creates an instance of ICity with no neigboard and identifier equals to 0.
		ICity city = modelFactory.createCity(EXPECTED_CITY_ID);
		
		Assert.assertNotNull(city);
		Assert.assertTrue(city instanceof ICity);
		Assert.assertEquals(EXPECTED_CITY_ID, city.getCityId());
	}
}
